package com.food.schedule;

import com.food.utils.GenerateData;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

/**
 * @author : 港某
 * @date : 2021/2/24 15:47
 */
@EnableScheduling
@Configuration
public class GenerateDataSchedule {

    @Resource
    GenerateData generateData;

    /**
     * 每1小时 执行一次
     */
    @Scheduled(cron = "0 0 0/6 * * ?")
    void getData() {
        //获取高德api数据
        generateData.generateData();
        //获取百度api数据
        generateData.generateDataBaidu();
        //腾讯
        generateData.generateDataTx();
    }


}
